<div style="min-height: 300px;" class="portlet x12">
	<div class="portlet-header"><h4><?php if (isset($action) && $action =='addtheme') { ?>Th&#234;m m&#7899;i <?php } else { ?> S&#7917;a <?php } ?></h4></div>			
		<div class="portlet-content" >		
			<form class="form label-inline" style="width: 100%;" id="form_edit_add" method="post" action="<?php echo base_url();?>admin/gallery/<?php echo $action;?>" enctype="multipart/form-data">
				<div style="width : 50%; float:left;">
				<div class="field">
					<label for="fname" >T&#234;n</label>
					<input type="text" class="medium" size="50" name="name" id="name" value="<?php echo (isset($detail->name))?$detail->name:"";?>">					
				</div>
				
				<div class="field">
					<label for="image">H&#236;nh &#7843;nh</label>
					<input type="file" name="img" />
				</div>
				</div>
				<div><?php if(isset($detail->file_name)){ ?><img src="<?php echo base_url (); ?>application/storage/images/<?php echo $detail->file_name; ?>" alt="picture" /><?php } ?></div>
				<div class="field">
					<label for="description">M&#244; t&#7843;</label>
				</div>
				<div class="field">
					<?php 
					$config_mini = array(); 
 
			        $config_mini['toolbar'] = array(
			            array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ,'-', 'Link', 'Unlink', 'Anchor','Image')
			        );
			        $config_mini['filebrowserBrowseUrl'] = base_url()."ckeditor/kcfinder/browse.php";
			        $config_mini['filebrowserImageBrowseUrl'] = base_url()."ckeditor/kcfinder/browse.php?type=images";
			        $config_mini['filebrowserUploadUrl'] = base_url()."ckeditor/kcfinder/upload.php?type=files";
			        $config_mini['filebrowserImageUploadUrl'] = base_url()."ckeditor/kcfinder/upload.php?type=images";
			 
					echo $this->ckeditor->editor("description", (isset($detail->description))?$detail->description:"");
					?>					
				</div>				
									
				<br>				
				
				<input type="hidden" name="id" id="id" value="<?php echo (isset($detail->id))?$detail->id:"";?>">								
				<div class="buttonrow" align="center" style="margin-left:165px">					
					<button class="btn btn-orange" value="Save">Save</button>
					<input type="button" class="btn btn-grey" id="Cancel" value="Cancel">					
				</div>
		</form>
		<br><br>		
	</div>
</div>
<script>
$(document).ready(function(){
	$('.btn-grey').live('click',function(){				
		 parent.history.back();
	     return false;
	});
	$('.btn').click(function(){					
		$('#form_edit_add').submit();		
	});	
});

</script>